feat: Add REST API endpoints for React migration (Phase 1)#88
Open
devin-ai-integration[bot] wants to merge 1 commit intoDevOpsfrom
Open
feat: Add REST API endpoints for React migration (Phase 1)#88devin-ai-integration[bot] wants to merge 1 commit intoDevOpsfrom
devin-ai-integration[bot] wants to merge 1 commit intoDevOpsfrom
Conversation
- Add JWT dependencies to pom.xml - Create DTO classes for API request/response communication - Create JwtUtil and JwtAuthenticationFilter for JWT authentication - Create BankApiController with REST endpoints for account operations - Create AuthController with login/register endpoints - Update SecurityConfig to support both JWT and form-based authentication Co-Authored-By: Eashan Sinha <eashan.sinha@codeium.com>
Author
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR implements Phase 1 of the backend API conversion to support a future React frontend migration. The changes add REST API endpoints that return JSON responses alongside the existing Thymeleaf-based server-side rendering, allowing both to coexist.
Key changes include adding JWT-based authentication for API endpoints under
/api/**, creating DTO classes for API request/response communication, and implementing new REST controllers for banking operations (deposit, withdraw, transfer) and authentication (login, register).The existing
BankControllerand Thymeleaf templates remain intact. The security configuration now uses two separate filter chains: one for API endpoints (stateless JWT) and one for web endpoints (form-based sessions).Review & Testing Checklist for Human
JwtUtil.javauses a hardcoded default secret. Verify thatjwt.secretwill be configured via environment/properties in production deployments./api/**endpoints use JWT auth while existing web routes (/login,/dashboard, etc.) still work with form-based auth./api/auth/registerwith{"username": "test", "password": "test123"}/api/auth/loginwith same credentials, capture the JWT token/api/accountwithAuthorization: Bearer <token>header/api/depositwith{"amount": 100}and the auth headerNotes
BankControllerwas intentionally left unchanged per requirements